local sk__lihun_active = fk.CreateSkill {

  name = "sk__lihun_active&",

  tags = {},

}



sk__lihun_active:addEffect("active", {
  name = "sk__lihun_active&",
  mute = true,
  prompt = "#sk__lihun_active",
  card_filter = function(self, player, to_select, selected)
    local room = Fk:currentRoom()
    if #selected == 0 and room:getCardArea(to_select) ~= Card.PlayerEquip then
      local card = Fk:getCardById(to_select)
      return card.skill:canUse(player, card, { bypass_times = true, bypass_distances = true }) or
          table.contains({ "peach", "ex_nihilo", "foresight", "bogus_flower", "wd_rice" }, card.trueName) or
          card.type == Card.TypeEquip or card.sub_type == Card.SubtypeDelayedTrick or card.multiple_targets --预选目标救救
    end
  end,
  target_filter = function(self, player, to_select, selected, selected_cards)
    if #selected_cards == 1 then
      local card = Fk:getCardById(selected_cards[1])
      if #selected >= card.skill:getMaxTargetNum(player, card) then return false end
      return true
    end
  end,
  feasible = function(self, player, selected, selected_cards)
    if #selected_cards == 1 then
      local card = Fk:getCardById(selected_cards[1])
      return #selected >= card.skill:getMinTargetNum(player) and #selected <= card.skill:getMaxTargetNum(player, card)
    end
  end,
  on_use = function(self, room, effect)
    room:useCard({
      from = effect.from,
      tos = effect.tos,
      card = Fk:getCardById(effect.cards[1]),
    })
  end,
})

return sk__lihun_active
